url: str = "/home/xieweig/document"
buf :int = 4
with open(url + "/k.txt", mode='wb') as k:
    with open(url + "/a.txt", mode='r', encoding='utf-8') as a:
        # buf = 4
        while True:
            aa = a.read(buf)
            if not aa:
                break
            print("aa=> {0}".format(aa))
            k.write(aa.encode('gbk'))
    print(k.tell())
    with open(url+'/b.txt',mode='r',encoding='utf-8') as b:
        # buf=4
        while True :
            bb = b.readline()
            if not bb:
                break
            print("bb => {0}".format(bb))
            k.write(bb.encode('utf-8'))
